home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Info-Mac 3
/
Info_Mac_1994-01.iso
/
Development
/
Source
/
MSG Graphic Effects 1.0 Source
/
Corner circle.c
< prev
next >
Wrap
Text File
|
1993-08-23
|
2KB
|
59 lines
/*******************************************************************************
* Copyright © 1992-1993 Mark Pilgrim *
* *
* This file is provided as is, and may be freely distributed unaltered. This *
* message must accompany any copy of this file. This file may be used or *
* modified for use for a non-commercial product provided that appropriate *
* credit is given to the author named above. *
* Commercial use of this source code is prohibited. *
******************************************************************************/
#include "msg misc.h"
#include "msg timing.h"
#define gap 8 /* difference between one radius and the next */
#define CorrectTime 2
void CornerCircle(GrafPtr);
/* Make progressively larger circle regions, centered at the top-left corner
of the screen. Quickdraw takes care of all the excess space off the screen
that you include in the region. */
void CornerCircle(GrafPtr sourceGrafPtr)
{
Rect theRect;
int cx, cy;
RgnHandle curregion;
Point zeropoint;
theRect.left=-gap;
theRect.right=gap;
theRect.top=-gap;
theRect.bottom=gap;
curregion=NewRgn();
zeropoint.v=MAIN_WINDOW_HEIGHT;
zeropoint.h=MAIN_WINDOW_WIDTH;
do
{
StartTiming();
SetEmptyRgn(curregion);
OpenRgn();
FrameOval(&theRect);
CloseRgn(curregion);
CopyBits(&(sourceGrafPtr->portBits), &(gMainWindow->portBits),
&theRect, &theRect, 0, curregion);
theRect.left-=gap;
theRect.right+=gap;
theRect.top-=gap;
theRect.bottom+=gap;
TimeCorrection(CorrectTime);
}
while (!(PtInRgn(zeropoint,curregion)));
DisposeRgn(curregion);
}